App安装界面:
<?php // Awesome Facebook Application // // Name: PushFromJava // require_once 'client/facebook.php'; // Create our Application instance. $facebook = new Facebook(array( 'appId' => 'App Key', 'secret' => 'App Secrect Key', 'cookie' => true, )); $session = $facebook->getSession(); $fbme = null; $loginUrl = $facebook->getLoginUrl(array('canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'publish_stream', // 要求权限 'next' => $canvas_base_url . 'welcome.php', // 安装成功后转向地址 'cancel_url' => $canvas_base_url )); echo '{script}top.location.href = "' . $loginUrl . '"{/script}'; // 为了方便发布代码, 将
如果需要直接安装, 则不需要创建任何界面, 直接访问:http://www.facebook.com/login.php?api_key=<!替换为自己的API_KEY!>
获得授权可访问:
http://www.facebook.com/login.php?api_key=APIKEYXxxxxxxxxxxxxxxxxx&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access
Facebook: 手动获得one-time code与Infinite SessionKey <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.